<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>CSS渐变</title>
        <style>
            *{
                margin: 0;
                padding: 0;
            }
            .s{
                clear: both;
                content: "";
                display: block;
            }
            li{
                list-style: none;
                width: 300px;
                height: 300px;
                border: 1px solid ghostwhite;
            }
            .s li:nth-of-type(1){
                background-image: linear-gradient(to top right,red ,yellow,peru);
            }
            .s li:nth-of-type(2){
                background-image: linear-gradient(to right,red 100px ,yellow 150px,peru 200px);
            }
            .s li:nth-of-type(3){
                /* 0-10px 红色纯色 10px-50px 红色到蓝色的过渡 50px之后是蓝色纯色*/
                background-image: repeating-linear-gradient(red 10px,blue 20px, green 40px);
            }
            .s li:nth-of-type(4){
                border-radius: 50%;
                /* 0-10px 红色纯色 10px-50px 红色到蓝色的过渡 50px之后是蓝色纯色*/
                background-image: repeating-radial-gradient(red 20px,yellow 40px ,blue 60px);
            }
        </style>
    </head>
    <body>
        <ul class="s">
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </body>
</html>